package cm.cool.web.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import cm.cool.web.bean.OrderDto;
import cm.cool.web.bean.UserDto;
import cm.cool.web.service.OrderService;
import cm.cool.web.service.UserService;
import cm.cool.web.util.respon.R;

@RestController
@RequestMapping("/index")
public class IndexController {
	
	@Autowired
	private UserService userService;
	
	@Autowired
	private OrderService orderService;
	
	
	/**
	 * 查询今日总访客
	 * @param user
	 * @return
	 */
	@RequestMapping("/getLastTime")
	public R getLastTime(UserDto user){
		return userService.getLastTime(user);
	} 
	
	/**
	 * 查询今日总成交额
	 * @param user
	 * @return
	 */
	@RequestMapping("/getTotalPrice")
	public R getTotalPrice(OrderDto order){
		return orderService.getTotalPrice(order);
	} 
	
	/**
	 * 查询今日订单数
	 * @param user
	 * @return
	 */
	@RequestMapping("/getTotalNum")
	public R getTotalNum(OrderDto order){
		return orderService.getTotalNum(order);
	} 
}
